import 'package:flutter_test/flutter_test.dart';
import 'package:component_websocket/component_websocket.dart';
import 'package:component_websocket/component_websocket_platform_interface.dart';
import 'package:component_websocket/component_websocket_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockComponentWebsocketPlatform
    with MockPlatformInterfaceMixin
    implements ComponentWebsocketPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final ComponentWebsocketPlatform initialPlatform = ComponentWebsocketPlatform.instance;

  test('$MethodChannelComponentWebsocket is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelComponentWebsocket>());
  });

  test('getPlatformVersion', () async {
    ComponentWebsocket componentWebsocketPlugin = ComponentWebsocket();
    MockComponentWebsocketPlatform fakePlatform = MockComponentWebsocketPlatform();
    ComponentWebsocketPlatform.instance = fakePlatform;

    expect(await componentWebsocketPlugin.getPlatformVersion(), '42');
  });
}
